<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center commentPage_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub commentPage_fd0_0'>
          <view class='flex flex-wrap align-center commentPage_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  commentPage_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='commentPage_fd0_0_c1_c0'>评论</text>
          </view>
          <view class='flex flex-wrap align-center justify-end commentPage_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout commentPage_flex_1">
        <template v-for='(item,key0) in commentList'>
          <view class='flex flex-wrap align-start commentPage_fd1_0' @tap.stop="goNato(item)" data-type="navigateTo"
            :data-url="`/pages/zuju/organizationalDetails/organizationalDetails?aid=${item.postquestion_id}`"
            :key='key0'>
            <view class='commentPage_fd1_0_c0' @click.stop=goUserHome(item)>
              <image mode="aspectFill" :src='item.avatar'></image>
              <view class="dian" v-if="item.is_read==0"></view>
            </view>
            <!-- <image class='commentPage_fd1_0_c0' mode="aspectFill" :src='item.avatar'></image> -->
            <view class='flex flex-wrap align-start justify-between flex-sub commentPage_fd1_0_c1'>
              <view class='flex flex-direction flex-wrap align-start flex-sub'>
                <text class='commentPage_fd1_0_c1_c0_c0'>{{item.nickname}}</text>
                <view class='flex flex-wrap align-center commentPage_fd1_0_c1_c0_c1'>
                  <text class='commentPage_fd1_0_c1_c0_c1_c0'>{{item.msg}}</text>
                  <!-- <text class='commentPage_fd1_0_c1_c0_c1_c0'>{{item.postcomment_content}}</text> -->
                  <text class='commentPage_fd1_0_c1_c0_c1_c1'>{{item.create_time}}</text>
                </view>
                <text class='commentPage_fd1_0_c1_c0_c2'>{{item.postcomment_content}}</text>
                <!-- <view class='flex flex-wrap align-center commentPage_fd1_0_c1_c0_c3' v-if="item.jump_type==2">
                  <view class='flex flex-wrap align-center commentPage_fd1_0_c1_c0_c3_c0'>
                    <image class='commentPage_fd1_0_c1_c0_c3_c0_c0' mode="aspectFill" :src='STATIC_URL+"39.png"'>
                    </image>
                    <text class='commentPage_fd1_0_c1_c0_c3_c0_c1'>回复评论</text>
                  </view>
                  <image class='commentPage_fd1_0_c1_c0_c3_c1' mode="aspectFill" :src='STATIC_URL+"40.png"'
                    @tap.stop="likeCancellationFunc(item.jump_type,item.postquestion_id,item.postcomment_id)"></image>
                </view> -->
              </view>
              <image v-if="item.jump_type!=3" class='commentPage_fd1_0_c1_c1' mode="aspectFit"
                :src='item.postquestion.image'></image>
            </view>
          </view>
        </template>
        <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
          :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
      </view>

      <!---flex布局flex布局结束-->


    </view>
  </view>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  import {
    validate
  } from '@/common/utils/validate.js'

  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "commentList": []
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {

    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {
      this.getcommentListFunc()
    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {
      this.getcommentListFunc()
    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      goUserHome(item) {
        uni.navigateTo({
          url: `/pages/wode/myFans/userHome?uid=${item.user_id_2}`
        })
      },
      goNato(item) {
        this.$api.post(global.apiUrls.post65b9f06edc3cc, {
          aid: item.aid
        }).then(res => {
          if (res.data.code == 1) {
            if (item.jump_type == 3) {
              uni.navigateTo({
                url: `/pages/zuju/organizationalDetails/organizationalDetails?aid=${item.postoffice_id}`,
              });
            } else {
              uni.navigateTo({
                url: `/pages/shouye/postquestionsDetails/postquestionsDetails?id=${item.postquestion_id}`,
              });
            }

          }
        })

      },
      //获取评论@列表
      getcommentListFunc() {
        this.minixPagingListsApi = global.apiUrls.post657aa20cc2230;
        this.pageingListApiMethod = 'post';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {}
        this.listData = [];
        this.commentList = this.listData;
        this.pagingListToggle();

      },
      //点赞取消
      async likeCancellationFunc() {
        //请求方法
        //数据验证

        let data657910f8d85a1 = await this.$api.post(global.apiUrls.post657910f8d85a1, {
          type: type,
          postquestion_id: postquestion_id,
          postcomment_id: postcomment_id,
          action: action
        });

        if (data657910f8d85a1.data.code != 1) {
          this.$message.info(data657910f8d85a1.data.msg);
          return
        }



      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(255, 255, 255, 1);
    background-size: 100% auto;
  }

  .commentPage_flex_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .commentPage_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .commentPage_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .commentPage_fd0_0_c0 {
    width: 120rpx;
  }

  .commentPage_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .commentPage_flex_1 {
    padding: 32rpx 32rpx 0rpx 32rpx;
  }

  .commentPage_fd1_0_c1_c1 {
    width: 90rpx;
    height: 90rpx;
    border-radius: 16rpx;
  }

  .commentPage_fd1_0_c1_c0_c3_c1 {
    width: 28rpx;
    height: 28rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 0rpx 0rpx 30rpx;
  }

  .commentPage_fd1_0_c1_c0_c3_c0_c1 {
    color: #6450EB;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 24rpx;
  }

  .commentPage_fd1_0_c1_c0_c3_c0_c0 {
    width: 28rpx;
    height: 28rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 8rpx 0rpx 0rpx;
  }

  .commentPage_fd1_0_c1_c0_c3_c0 {
    background: rgba(100, 80, 235, 0.08);
    padding: 4rpx 24rpx 4rpx 24rpx;
    border-radius: 20rpx;
    background-size: 100% auto;
  }

  .commentPage_fd1_0_c1_c0_c3 {
    margin: 12rpx 0rpx 0rpx 0rpx;
  }

  .commentPage_fd1_0_c1_c0_c2 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 42rpx;
    margin: 24rpx 0rpx 0rpx 0rpx;
    width: 440rpx;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }

  .commentPage_fd1_0_c1_c0_c1_c1 {
    margin: 0rpx 0rpx 0rpx 17rpx;
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .commentPage_fd1_0_c1_c0_c1_c0 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .commentPage_fd1_0_c1_c0_c1 {
    margin: 16rpx 0rpx 0rpx 0rpx;
  }

  .commentPage_fd1_0_c1_c0_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 700;
    line-height: 42rpx;
  }

  .commentPage_fd1_0_c1 {
    border-bottom: 1px solid #eee;
    padding: 0rpx 0rpx 32rpx 0rpx;
  }

  .commentPage_fd1_0_c0 {
    width: 90rpx;
    height: 90rpx;
    border-radius: 50%;
    margin: 0rpx 24rpx 0rpx 0rpx;
    position: relative;

    image {
      width: 90rpx;
      height: 90rpx;
      border-radius: 50%;
    }

    .dian {
      position: absolute;
      right: 0;
      top: 0;
      width: 16rpx;
      height: 16rpx;
      background: red;

      border-radius: 50%;
      z-index: 9
    }
  }

  .commentPage_fd1_0 {
    margin: 0rpx 0rpx 32rpx 0rpx;
  }
</style>
